import { createSSRApp } from 'vue'
import store from '@/store'
import i18n from '@/i18n'
import { checkVersion } from '@/i18n/index'

import App from './App.vue'
import '@/analytics/TingYun'
import GetPhoneNumber from '@/common/getPhoneNumber.vue'
import AltPicture from '@/common/altPicture.vue'
import TrackButton from '@/dataReport/components/TrackButton.vue'
import SwitchControl from './common/switchControl.vue'

export function createApp() {
  const app = createSSRApp(App)
  app.use(store)
  app.use(i18n)
  app.component('getPhoneNumber', GetPhoneNumber)
  app.component('alt-picture', AltPicture)
  app.component('track-button', TrackButton)
  app.component('switch-control', SwitchControl)
  return {
    app,
    store,
  }
}
